<template>
  <div class="app-container">
    <el-card>
      <el-row :gutter="15">
        <el-col :span="4">
          <el-input
            v-model="listQuery.title"
            size="small"
            placeholder="请输入获奖名称"
            clearable
          />
        </el-col>

        <el-col :span="4">
          <el-input
            v-model="listQuery.author_name"
            size="small"
            placeholder="请输入获奖者名称"
            clearable
          />
        </el-col>
        <el-col :span="4">
          <el-select
            v-model="listQuery.student_faculty"
            placeholder="请选择学生所属学院"
            clearable
            filterable
            size="small"
          >
            <el-option
              v-for="item in facultyList"
              :key="item.faculty_code"
              :label="item.faculty_title"
              :value="item.faculty_code"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="4">
          <el-select
            v-model="listQuery.teacher_faculty"
            placeholder="请选择老师所属学院"
            clearable
            filterable
            size="small"
          >
            <el-option
              v-for="item in facultyList"
              :key="item.faculty_code"
              :label="item.faculty_title"
              :value="item.faculty_code"
            >
            </el-option>
          </el-select>
        </el-col>

        <el-col :span="8">
          <el-button
            type="success"
            size="small"
            icon="el-icon-search"
            @click.native="handleFilter"
            >搜索</el-button
          >
          <el-button
            type="primary"
            size="small"
            icon="el-icon-refresh"
            @click.native="resetFilter"
            >重置</el-button
          >
        </el-col>
      </el-row>
    </el-card>

    <el-card style="margin-top:10px;">
      <el-table
        :key="tableKey"
        v-loading="listLoading"
        :data="list"
        border
        fit
        highlight-current-row
        :header-cell-style="{ background: '#f5f7fa' }"
        max-height="650"
        style="width: 100%;margin-top:10px;"
      >
        <el-table-column
          fixed
          label="奖励名称"
          align="center"
          prop="title"
          min-width="250"
        ></el-table-column>
        <el-table-column label="完成单位" align="center" prop="complete_unit" />
        <!-- <el-table-column label="获奖完成人" align="center" prop="all_authors" /> -->
        <el-table-column label="获奖日期" align="center" prop="prize_date" />
        <el-table-column
          label="获奖类别"
          align="center"
          prop="prize_category_name"
        />
        <el-table-column
          label="获奖级别"
          align="center"
          prop="prize_level_name"
        />
        <el-table-column
          label="获奖等级"
          align="center"
          prop="prize_rank_name"
        />
        <el-table-column label="成果名称" align="center" prop="results_name" />
        <el-table-column
          label="发证机关"
          align="center"
          prop="licence_issuing_authority"
        />
        <!-- 不知道为啥报错 -->
        <el-table-column label="一级审核状态" align="center">
          <template slot-scope="{ row }">
            <el-tag :type="row.first_check_status | statusFilter" size="mini">
              {{ row.first_check_status }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="操作" min-width="300px" align="center">
          <template slot-scope="{ row }">
            <el-button
              type="primary"
              size="mini"
              plain
              icon="el-icon-check"
              @click.native="handleCheck(row)"
            >
              审核
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="listQuery.page"
        :limit.sync="listQuery.limit"
        @pagination="getList"
      />
    </el-card>
  </div>
</template>

<script src="./index.js"></script>

<style>
.block {
  padding: 10px 0px;
}
</style>
